import request from '@/utils/request'
let baseUrl =
  process.env.NODE_ENV === 'production' ? '/api/riskTrial' : '/riskTrial'
// 特征列表list
export const getFeatureList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/list',
    method: 'post',
    data
  })
//特征列表 没有分页
export const getFeatureListNoPage = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/list-no-page',
    method: 'post',
    data
  })
// 新增指标
export const getDatasource = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/load-datasource',
    method: 'post',
    data
  })

// 添加保存
export const getUp = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/up',
    method: 'post',
    data
  })
// 使用统计
export const getrefFiles = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/load-ref-files',
    method: 'post',
    data
  })
// 测试指标
export const test = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/test',
    method: 'post',
    data
  })
// 删除
export const del = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/delete',
    method: 'post',
    data
  })
// 导出
export const listDownload = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/risk/feature/download',
    method: 'post',
    responseType: 'blob',
    data
  })

// 导入
export const uploadURL = baseUrl + '/risk/feature/upload'
export const downloadURL = baseUrl + '/risk/feature/download-example'
